<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,com.jobportal.MyFunctions"%>

<HEAD>


	<script LANGUAGE="Javascript" SRC="Images/validate.js"></script>


	<LINK href="styles.css" type="text/css" rel="stylesheet">

</HEAD>
<BODY class=Grad>
<h2 align=center>Post New Interview</h2>

<%

	Connection con;
	ResultSet rs=null;
	Statement stmt=null;
	String InterviewID = "";	
	MyFunctions MF = new MyFunctions();
	InterviewID = MF.genNextID("interviewdetails","InterviewID","JOB");


	String JobTitle = request.getParameter("JobTitle");	
	String JobDescription = request.getParameter("JobDescription");
	String Eligbility = request.getParameter("Eligbility");
	String Location = request.getParameter("Location");	
	String ApplyBefore = request.getParameter("ApplyBefore");	
	String CompanyName = request.getParameter("CompanyName");	
	String CompanyProfile = request.getParameter("CompanyProfile");	
	String EmailToApply = request.getParameter("EmailToApply");
	String WebSite = request.getParameter("WebSite");	
	String ExecutiveName = request.getParameter("ExecutiveName");	
	String Address = request.getParameter("Address");	
	String Telephone = request.getParameter("Telephone");	
	String Fax = request.getParameter("Fax");	
	String DateOfPosting = request.getParameter("DateOfPosting");	
	String FunctionalArea = request.getParameter("FunctionalArea");
	String MinExperience = request.getParameter("MinExperience");
	String MaxExperience = request.getParameter("MaxExperience");

	try{
			
			con=(Connection)session.getAttribute("connection");
			stmt =  con.createStatement();
	
			
			String Query = "Insert into interviewdetails values('"+InterviewID+"','"+JobTitle+"','"+JobDescription+"','"+Eligbility+"','"+Location+"','"+ApplyBefore+"','"+CompanyName+"','"+CompanyProfile+"','"+EmailToApply+"','"+WebSite+"','"+ExecutiveName+"','"+Address+"',"+Telephone+",'"+Fax+"','"+DateOfPosting+"','"+FunctionalArea+"','"+MinExperience+"','"+MaxExperience+"')";
			System.out.println(Query);
			int result = stmt.executeUpdate(Query);
			if( result > 0)	{
				%><h3 align=center>Inserted into database sucessfully</h3><%
			}
			else{
				%><h3 align=center>Error in updating..please try again</h3><% 
			}
		}catch(Exception e){%><%=e%><%}
	
%>
</BODY>


